package com.tingyuge.base.design.mediator;

import java.util.HashMap;
import java.util.Map;

/**
 * @Created by xiaodao
 */
public class President implements Mediator {


    private Map<String,Deparment> map = new HashMap<>();

    @Override
    public void register(String dname, Deparment deparment) {
        map.put(dname,deparment);
    }

    /***
     * 这里可以做些逻辑
     * @param name
     */
    @Override
    public void command(String name) {
            map.get(name).selfAction();

    }
}
